export default function () {
  wx.showLoading({
    title: '加载中',
  })
  return new Promise(resolve => {
    const userInfo = wx.getStorageSync('userInfo') ? JSON.parse(wx.getStorageSync('userInfo')) : {}
    const accessToken = wx.getStorageSync("accessToken");
    if (accessToken) {
      if (userInfo.status !== 0) {
        wx.reLaunch({
          url: '/pages/permissions/index',
        })
        return
      }
    }
    resolve(true)
    wx.hideLoading()
  })
}